package com.hospital.controller;

import com.hospital.entity.Grade;
import com.hospital.service.intf.GradeService;
import com.hospital.vo.PageBean;
import com.hospital.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/grade")
public class GradeController {

    @Autowired
    private GradeService gradeService;

    @RequestMapping("/add.do")
    public R add(Grade grade){
        return gradeService.add(grade);
    }

    @RequestMapping("/delete.do")
    public R delete(Integer id){
        return gradeService.delete(id);
    }

    @RequestMapping("/update.do")
    public R update(Grade grade){
        return gradeService.update(grade);
    }

    @RequestMapping("/select.do")
    public R select(){
        return gradeService.select();
    }

    @RequestMapping("/selectPage.do")
    public PageBean selectPage(String grade_name, int page, int limit){
        return gradeService.selectPage(grade_name, page, limit);
    }

}
